<?php
namespace Controller;

require_once("Model/quizHandler.php");

class DALcontroller{
	
	/**
	 * @var $mysqli (Database connection)
	 */
	private $mysqli;
	private $model;

	/**
	 * @param $mysqli (Database connection)
	 */
	public function __construct(\mysqli $mysqli){
		$this->mysqli = $mysqli;
		$this->model = new \Model\quizHandler($this->mysqli);
	}
	
	/**
	 * @param $quiz (The quiz to be added to the database)
	 */
	public function addQuizToDatabase(\Model\quizModel $quiz){
		$this->model->addQuizToDatabase($quiz);
	}
	
	/**
	 * @return Array (An array with all availible quizzes)
	 */
	public function getAllQuizzes(){
		return $this->model->getAllQuizzes();
	}
}
